Release 10.1A: OpenEdge Development:
ProDataSets
Local parameter passing example
Suppose that Procedure A has the ProDataSet definition for
dsOrderused in the example procedure. After filling the ProDataSet, it passes it to Procedure B, as shown:
Procedure B has the same static ProDataSet definition. Procedure B obtains a reference to
DATASETdsOrderwithout it being copied. Procedure B can then reference the current records inttOrderandttOlinedirectly. Buffer currency in Procedure B is the same as in Procedure A. For example, if Procedure B is responding to a record fill event for thettOrdertable, then the current record inttOrderis the one just filled:
Procedure B can also navigate through the ProDataSet and its temp-tables:
On return to Procedure A, any changes made by Procedure B are visible to Procedure A because the ProDataSet is the same object.
If
B.pis remote fromA.p, then the ProDataSet is copied into Procedure B because it is anINPUTparameter. It is not copied back to Procedure A. If it were defined as anINPUT-OUTPUTparameter, then any changes would be passed back across the network to Procedure A and the end result would be the same as if it had been called locally. Therefore theINPUT-OUTPUTmode should be used when changes can be made that should be seen by the caller. TheINPUTcase is supported so that when the called procedure does not make any changes, the ProDataSet is not needlessly copied back to Procedure A. TheOUTPUTcase is supported so that if the original data in the ProDataSet is not used by Procedure B and only Procedure B’s changes (creates or the result of aFILL) are to be used and passed back to Procedure A, the ProDataSet is not needlessly copied into Procedure B.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |